package com.user.command;

import com.user.pojo.User;

public abstract class AbstractCommandFactory {
	public static AbstractCommandFactory buildFactory(User user) {
		if (user != null && user.getId() != 0) {
			if ("admin".equals(user.getUserId())) {
				return new AdminCommandFactory();
			}
			return new UserCommandFactory();
		}
		return new SystemCommandFactory();
	}

	public abstract Command buildCommand(String cmd);
}
